package com.water.app.interfaces.shopping;

import com.water.app.*;
import com.water.app.Exceptions.BalanceException;
import com.water.app.Exceptions.StockException;

import java.util.List;
import java.util.Map;

public interface ShoppingService {

    public boolean deleteGoodsById(int userId, int goodsId);

    public boolean updateGoodsArbitrary(Map<Integer,Integer> errormap,Map<Integer,Integer> successMap);

    public List<Map<Integer, Double>> countGoodsPriceOneByOne(int userId);

    public boolean Checkout(Map<Integer,Integer> successMap,int userId);

    public int selectGoodsCount(int goodsId);

    Result sKill(int goodsId);

    public boolean insertCart(int userId, int goodsId, int number);

    public List<Goods> showCart(int userId);

    public boolean pay(List<Integer> goodsIdList, int userId,Integer addressId) throws StockException, BalanceException, InterruptedException;

    public void consumerPay(List<Integer> goodsIdList, int userId,Integer address) throws StockException, BalanceException;

    public address selectAddressById(Integer id);
}
